﻿Imports System.Text.RegularExpressions

''' <summary>
''' 表达式服务
''' 1. #开头为父属性
''' 2. $开头为自身属性
''' 3. @开头为同级对象
''' 4. {}为函数体
''' </summary>
Public Interface IExpressionService

    ''' <summary>
    ''' 获得父对象属性名称
    ''' </summary>
    ''' <param name="str"></param>
    ''' <returns></returns>
    Function GetParentPropertyName(ByRef str As String) As String

    ''' <summary>
    ''' 获得自身属性名
    ''' </summary>
    ''' <param name="str"></param>
    ''' <returns></returns>
    Function GetSelfProPertyName(ByRef str As String) As String


    ''' <summary>
    ''' 获取函数
    ''' </summary>
    ''' <param name="str"></param>
    ''' <returns></returns>
    Function GetFunction(ByRef str As String) As String

    ''' <summary>
    ''' 计算
    ''' </summary>
    ''' <param name="part"> 工件 </param>
    ''' <param name="jsCode"> 代码 </param>
    ''' <returns></returns>
    Function eavl(ByRef part As PartEntity, ByRef jsCode As String) As String


    ''' <summary>
    ''' 计算js代码
    ''' </summary>
    ''' <param name="jsCode"> js代码 </param>
    ''' <returns> 返回计算结果 </returns>
    Function eavl(ByRef jsCode As String) As String


    Function eavl(ByRef dr As DataRow, ByRef jsCode As String) As Object

    Function evalPlate(ByRef dr_parent As DataRow, ByRef dr_self As DataRow, ByRef jsCode As String) As Object

End Interface
